home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / reset_sh.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  2KB  |  69 lines

  1. #include <string.h>
  2. #define    CURSES_LIBRARY    1
  3. #include <curses.h>
  4. #undef    reset_shell_mode
  5.  
  6. #ifdef PDCDEBUG
  7. char *rcsid_reset_sh = "$Header: C:\CURSES\portable\RCS\reset_sh.c 2.1 1993/06/18 20:20:58 MH Rel MH $";
  8. #endif
  9.  
  10. #ifndef UNIX
  11.  
  12.  
  13. /*man-start*********************************************************************
  14.  
  15.   reset_shell_mode()    - restore terminal mode
  16.  
  17.   X/Open Description:
  18.      Restore the terminal to "program" (in curses) or "shell" (out
  19.      of curses) state.  These are done automatically by endwin()
  20.      and doupdate() after an endwin(), so they would normally not
  21.      be called before these functions.
  22.  
  23.   PDCurses Description:
  24.      Under the Flexos platform, PDCurses operates in 16-bit mode.
  25.      Normally, the Flexos shell operates in 8-bit mode.
  26.  
  27.   X/Open Return Value:
  28.      The reset_shell_mode() routine returns OK on success otherwise ERR
  29.      is returned.
  30.  
  31.   Portability:
  32.      PDCurses    int reset_shell_mode( void );
  33.      X/Open Dec '88    int reset_shell_mode( void );
  34.      SysV Curses    int reset_shell_mode( void );
  35.      BSD Curses    int reset_shell_mode( void );
  36.  
  37. **man-end**********************************************************************/
  38.  
  39. int    reset_shell_mode(void)
  40. {
  41. #ifdef PDCDEBUG
  42.     if (trace_on) PDC_debug("reset_shell_mode() - called\n");
  43. #endif
  44.  
  45.     if    (c_sh_tty.been_set == TRUE)
  46.     {
  47.  
  48.         memcpy(&_cursvar, &c_sh_tty.saved, sizeof(SCREEN));
  49.  
  50.         mvcur(0, 0, c_sh_tty.saved.cursrow, c_sh_tty.saved.curscol);
  51.         if (PDC_get_ctrl_break() != c_sh_tty.saved.orgcbr)
  52.             PDC_set_ctrl_break(c_sh_tty.saved.orgcbr);
  53.         if (c_sh_tty.saved.raw_out)
  54.             raw();
  55.         if (c_sh_tty.saved.visible_cursor)
  56.             curson();
  57.         _cursvar.font = PDC_get_font();
  58.         PDC_set_font(c_sh_tty.saved.font);
  59.         if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(),  c_sh_tty.saved.scrnmode))
  60.             PDC_set_scrn_mode(c_sh_tty.saved.scrnmode);
  61.         PDC_set_rows(c_sh_tty.saved.lines);
  62.     }
  63. #ifdef    FLEXOS
  64.     _flexos_8bitmode();
  65. #endif
  66.     return( OK );
  67. }
  68. #endif
  69.